package com.hushao.lims.weblims.repository;

import com.hushao.lims.weblims.domain.*;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

/**
 * @author 930588706
 * @date 18/2/3
 */
public interface TimetableRepository extends JpaRepository<TimetableInfo,Long> {
    Page<TimetableInfo> findByTeacherInfo_TeacherNameLikeAndTermInfo_TermLike(String teacherName, String term, Pageable pageable);

    /**
     * 根据教师以及学期查询课程
     * @param teacher
     * @param term
     * @return
     */
    List<TimetableInfo> findByTeacherInfoAndTermInfo(TeacherInfo teacher, TermInfo term);

    /**
     * 根据班级，学期查询课程
     * @param classInfo
     * @param termInfo
     * @return
     */
    List<TimetableInfo> findByClassInfoAndTermInfo(ClassInfo classInfo, TermInfo termInfo);

    /**
     * 根据实验室，学期查询课程
     * @param classroom
     * @param termInfo
     * @return
     */
    List<TimetableInfo> findByClassroomInfoAndTermInfo(ClassroomInfo classroom, TermInfo termInfo);
}
